
include_directories(${CrimsonCore_SOURCE_DIR}/tools/crimson_editor)
include_directories(${CrimsonCore_BINARY_DIR}/tools/crimson_editor)

add_definitions(-D_USE_MATH_DEFINES)

set(
	CEDITOR_GENERAL_SOURCES
	autoassignprogrambinding.cpp
	autoassignprogrambinding.h
	baseeditor.cpp
	baseeditor.h
	baseitemmodel.cpp
	baseitemmodel.h
	baseview.cpp
	baseview.h
	changeloddialog.cpp
	changeloddialog.h
	colorpicker.cpp
	colorpicker.h
	config.h
	enums.h
	genericdeletedialog.cpp
	genericdeletedialog.h
	genericrenamedialog.cpp
	genericrenamedialog.h
	genericsavedialog.cpp
	genericsavedialog.h
	geometrypool.cpp
	geometrypool.h
	grouptreeitem.cpp
	grouptreeitem.h
	grouptreeitemview.cpp
	grouptreeitemview.h
	main.cpp
	mainwindow.cpp
	mainwindow.h
	materialdatalistmodel.cpp
	materialdatalistmodel.h
	materialmanager.cpp
	materialmanager_xml.cpp
	materialmanager.h
	objectmanager.cpp
	objectmanager.h
	objectmanager_xml.cpp
	scene.cpp
	scene.h
	sceneimporter.cpp
	sceneimporter.h
	sceneloader.cpp
	sceneloader.h
	scenewriter.cpp
	scenewriter.h
	session.cpp
	session.h
	timeframewidget.cpp
	timeframewidget.h
	transformationeditdialog.cpp
	transformationeditdialog.h
	transformationeditwidget.cpp
	transformationeditwidget.h
	)

set(
	CEDITOR_MEDIA
	media/style.qss
	)

set(
	CEDITOR_MATERIALEDITOR_SOURCES
        material/editoreffect.cpp
        material/editoreffect.h
        material/editoreffectprogram.cpp
        material/editoreffectprogram.h
        material/editorprogram.cpp
        material/editorprogram.h
        material/editorshader.cpp
        material/editorshader.h
	material_editor/basematerialeditor.cpp
	material_editor/basematerialeditor.h
	material_editor/changeshadertypedialog.cpp
	material_editor/changeshadertypedialog.h
	material_editor/createnewshaderdialog.cpp
	material_editor/createnewshaderdialog.h
	material_editor/effecteditor.cpp
	material_editor/effecteditor.h
	material_editor/glslsyntaxhighlighter.cpp
	material_editor/glslsyntaxhighlighter.h
	material_editor/glsltexteditor.cpp
	material_editor/glsltexteditor.h
	material_editor/materialeditor.cpp
	material_editor/materialeditor.h
	material_editor/materialview.cpp
	material_editor/materialview.h
	material_editor/materialview_effect.cpp
	material_editor/materialview_material.cpp
	material_editor/materialview_program.cpp
	material_editor/materialview_texture.cpp
	material_editor/materialview_shader.cpp
	material_editor/materialview_texture.cpp
	material_editor/materialviewitems.cpp
	material_editor/materialviewitems.h
	material_editor/programeditor.cpp
	material_editor/programeditor.h
	material_editor/selectmaterialdatadialog.cpp
	material_editor/selectmaterialdatadialog.h
	material_editor/shadereditor.cpp
	material_editor/shadereditor.h
	material_editor/textureeditor.cpp
	material_editor/textureeditor.h
	)

set(
	CEDITOR_SCENEEDITOR_SOURCES
	scene_editor/sceneeditor.cpp
	scene_editor/sceneeditor.h
	scene_editor/scenetreemodel.cpp
	scene_editor/scenetreemodel.h
	scene_editor/sceneview.cpp
	scene_editor/sceneview.h
	scene_editor/transformerhandle.cpp
	scene_editor/transformerhandle.h
	)

set(
	CEDITOR_OBJECTBROWSER_SOURCES
	object_browser/objectbrowserview.cpp
	object_browser/objectbrowserview.h
	object_browser/objectstreemodel.cpp
	object_browser/objectstreemodel.h
	)

set(
	CEDITOR_OBJECTCOMPOSER_SOURCES
	object_composer/objectcomposerview.cpp
	object_composer/objectcomposerview.h
	)

set(
	CEDITOR_MOC_HEADERS
	baseeditor.h
	baseitemmodel.h
	baseview.h
	changeloddialog.h
	colorpicker.h
	genericdeletedialog.h
	genericrenamedialog.h
	genericsavedialog.h
	grouptreeitem.h
	grouptreeitemview.h
	mainwindow.h
	materialdatalistmodel.h
	materialmanager.h
	objectmanager.h
	session.h
        scene.h
	timeframewidget.h
	transformationeditdialog.h
	transformationeditwidget.h
	material_editor/basematerialeditor.h
	material_editor/changeshadertypedialog.h
	material_editor/createnewshaderdialog.h
	material_editor/effecteditor.h
	material_editor/glslsyntaxhighlighter.h
	material_editor/glsltexteditor.h
	material_editor/materialeditor.h
	material_editor/materialview.h
	material_editor/materialviewitems.h
	material_editor/programeditor.h
	material_editor/selectmaterialdatadialog.h
	material_editor/shadereditor.h
	material_editor/textureeditor.h
	object_browser/objectbrowserview.h
	object_browser/objectstreemodel.h
	object_composer/objectcomposerview.h
	scene_editor/sceneeditor.h
	scene_editor/scenetreemodel.h
	scene_editor/sceneview.h
	)

set(
	CEDITOR_UI_SOURCES
	ui/changelodwidget.ui
	ui/genericdeletewidget.ui
	ui/genericrenamewidget.ui
	ui/genericsavewidget.ui
	ui/timeframe.ui
	ui/transformationeditwidget.ui
	material_editor/ui/changeshadertypewidget.ui
	material_editor/ui/createnewshaderwidget.ui
	material_editor/ui/effecteditor.ui
	material_editor/ui/materialeditor.ui
	material_editor/ui/programeditor.ui
	material_editor/ui/programshadereditor.ui
	material_editor/ui/selectmaterialdatawidget.ui
	material_editor/ui/shadereditor.ui
	material_editor/ui/textureeditor.ui
	)

QT4_WRAP_CPP(
	CEDITOR_MOCCED_SOURCES
	${CEDITOR_MOC_HEADERS}
	)

QT4_WRAP_UI(
	CEDITOR_UIED_SOURCES
	${CEDITOR_UI_SOURCES}
	)

QT4_ADD_RESOURCES(
	CEDITOR_QRC_SOURCES
	resource.qrc
	)


source_group(
	"Sources"
	FILES
	${CEDITOR_GENERAL_SOURCES}
	)

source_group(
	"Sources\\material_editor"
	FILES
	${CEDITOR_MATERIALEDITOR_SOURCES}
	)

source_group(
	"Sources\\material_editor\\UI"
	FILES
	${CEDITOR_UI_SOURCES}
	)

source_group(
	"Sources\\scene_editor"
	FILES
	${CEDITOR_SCENEEDITOR_SOURCES}
	)

source_group(
	"Sources\\object_browser"
	FILES
	${CEDITOR_OBJECTBROWSER_SOURCES}
	)

source_group(
	"Sources\\object_composer"
	FILES
	${CEDITOR_OBJECTCOMPOSER_SOURCES}
	)


source_group(
	"Generated\\MOC"
	FILES
	${CEDITOR_MOCCED_SOURCES}
	)

source_group(
	"Generated\\UI"
	FILES
	${CEDITOR_UIED_SOURCES}
	)


add_executable(
	CrimsonEditor
	${CEDITOR_UIED_SOURCES}
	${CEDITOR_MOCCED_SOURCES}
	${CEDITOR_QRC_SOURCES}
	${CEDITOR_GENERAL_SOURCES}
	${CEDITOR_MATERIALEDITOR_SOURCES}
	${CEDITOR_OBJECTBROWSER_SOURCES}
	${CEDITOR_OBJECTCOMPOSER_SOURCES}
	${CEDITOR_SCENEEDITOR_SOURCES}
	${CEDITOR_MEDIA}
	)

target_link_libraries(
	CrimsonEditor
	${QT_LIBRARIES}
	CrimsonEngine
	CrimsonMotion
	)
